namespace CSharpPro._0923;

public class Demo
{
    //课堂练习
    public void TestPrint()
    {
        int y = 2025;
        bool flag = (y % 4 == 0 && y % 100 != 0) || (y % 400 == 0);
    }

    //作业1、判断闰年
    //1、能被4整除，并且不能被100整除
    //2、能被400整除
    public String IsLeapYear(int year)
    {
        if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
        {
            return "是闰年";
        }
        else
        {
            return "不是闰年";
        }
    }
    
    
    //作业2
    public void FinalPrice(int month, int transport)
    {
        const double originalPrice = 8800;
        double discount = 0;
        
        if (month >= 5 && month <= 10)
        {
            // 旺季
            if (transport == 1)
                discount = 0.9;
            else if (transport == 2)
                discount = 0.75;
        }
        else
        {
            // 淡季
            if (transport == 1)
                discount = 0.6;
            else if (transport == 2)
                discount = 0.3;
        }

        // 计算最终价格
        double finalPrice = originalPrice * discount;
        Console.WriteLine($"最终旅游价格：{finalPrice:C}");
    }
}